<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class baigiang extends CI_Controller {
	public function __construct() {
		parent::__construct();
		$this->load->model('model_baigiang');
		date_default_timezone_set("Asia/Ho_Chi_Minh");
	}

	public function index(){
		$data['baigiang'] = $this->model_baigiang->laythongtinbaigiang();

		$data['baitap'] = $this->model_baigiang->laybaitap();

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_baigiang",$data);
		$this->load->view("view_footer");
	}

	public function timbaigiang(){
		$data['baigiang'] = 
		$this->model_baigiang->timbaigiang($_POST['monhoc'], $_POST['lop'], $_POST['tengiaovien']);

		$data['baitap'] = $this->model_baigiang->laybaitap();

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_baigiang",$data);
		$this->load->view("view_footer");
	}
	public function timbaigiang2(){
		$mon = isset($_GET['mon'])?$_GET['mon']:'';
		$lop = isset($_GET['lop'])?$_GET['lop']:'';

		$data['baigiang'] = 
		$this->model_baigiang->timbaigiang($mon, $lop, '');

		$data['baitap'] = $this->model_baigiang->laybaitap();

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_baigiang",$data);
		$this->load->view("view_footer");
	}
}